#ifndef __FRUIT__H__
#define __FRUIT__H__

#include "cocos-ext.h"
#include "cocos2d.h"
#include "Config.h"

USING_NS_CC;
USING_NS_CC_EXT;
using namespace cocos2d::gui;


class Fruit : public CCSprite
{
public:

	/// 
	/// Khoi tao
	/// 
	/// type: loai qua dua vao
	/// p: diem xuat hien qua 
	/// left: ben trai hoac phai so voi cay
	///
	/// Khoi tao qua moi
	/// 
	///
	/// @author 
	/// time_create:
	/// time_end:
	///
	Fruit();
	Fruit(int type);
	Fruit(int type, CCPoint p);
	Fruit(int type, CCPoint p, int left);

	/// 
	/// Khoi tao
	/// 
	/// type: loai qua dua vao
	/// p: diem xuat hien qua 
	/// left: ben trai hoac phai so voi cay
	///
	/// Khoi tao qua moi, ban dau qua mac dinh se xuat hien san
	/// 
	///
	/// @author 
	/// time_create:
	/// time_end:
	///
	void initValueForAttribute(int type, CCPoint p, int left);

	/// 
	/// Select image
	/// 
	/// Chon anh tuong ung voi loai qua
	/// 
	///
	/// @author 
	/// time_create:
	/// time_end:
	///
	char* fSelectObjectImage();


	/// 
	/// load music
	/// 
	/// phan am thanh
	/// 
	///
	/// @author 
	/// time_create:
	/// time_end:
	///
	void fPreLoadMusic();

	/// 
	/// setter, geteter type
	///
	/// type: loai qua can thay doi
	/// 
	/// SetType: Thay doi loai qua
	/// GetType: tra ve loai qua hien tai
	/// 
	///
	/// @author 
	/// time_create:
	/// time_end:
	///
	inline void fSetType(int type){mType = type;};
	inline int fGetType(){return mType;};

	///
	/// Setter, Geteter trang thai hien tai cua qua
	/// 
	/// status: trang thai can thay doi
	///
	/// SetStatus: thay doi trang thai hien tai cua qua
	/// GetStatus: tra ve trang thai hien tai cua qua
	/// 
	///
	/// @author 
	/// time_create:
	/// time_end:
	///
	inline void fSetStatus(int status) {mNewStatus = status;}
	inline int fGetStatus() {return mCurrentStatus;}

	///
	/// Setter, Geteter trai phai so voi cay
	/// 
	/// left: ben trai hoac phai
	///
	/// SetIsLeft: Gan trai phai so voi cay cho qua
	/// GetIsLeft: Tra ve vi tri trai phai so voi cay
	/// 
	///
	/// @author 
	/// time_create:
	/// time_end:
	///
	inline void fSetIsLeft(int left) {mIsLeft = left;}
	inline int fGetIsLeft() {return mIsLeft;}
	
	/// 
	/// effect
	/// 
	/// Cac hanh dong tuong ung voi tung trang thai cua qua
	/// 
	///
	/// @author 
	/// time_create:
	/// time_end:
	///
	void fEffect();


private:

	int mType; // loai qua
	int mNewStatus; // trang thai moi
	int mCurrentStatus; // trang thai hien tai
	int mIsLeft; // la ben trai

};

#endif //Hoa qua